package org.example.lethear.dto.category;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

/**
 * 分类创建请求DTO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CategoryCreateRequest {
    
    @NotBlank(message = "分类名称不能为空")
    @Size(max = 50, message = "分类名称长度不能超过50个字符")
    private String name;
    
    @Size(max = 200, message = "分类描述长度不能超过200个字符")
    private String description;
    
    private Long parentId = 0L;
    
    private Integer sort = 0;
    
    private Boolean isActive = true;
    
    // 便利方法
    public Integer getStatus() {
        return (isActive != null && isActive) ? 1 : 0;
    }
} 